<?php $i = 0; $fullposts_num = 3;
if (get_option('glow_duplicate') == 'false') {
	$args=array(
	   'showposts'=>get_option('glow_homepage_posts'),
	   'post__not_in' => $ids,
	   'paged'=>$paged,
	   'category__in' => get_option('glow_exlcats_recent'),
	);
} else {
	$args=array(
	   'showposts'=>get_option('glow_homepage_posts'),
	   'paged'=>$paged,
	   'category__in' => get_option('glow_exlcats_recent'),
	);
};
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post();
$i++;?>

<?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
<?php if (($thumb == '') && ($glow_grab_image == 'on')) $thumb = catch_that_image(); ?>
	
<?php if ($i<$fullposts_num) { ?>
			<div class="new-post">
				<?php if (get_option('glow_postinfo1_show') == 'on') include(TEMPLATEPATH . '/includes/postinfo.php'); ?>
				<h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php truncate_title(50); ?></a></h2>
				<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=156&amp;w=156&amp;zc=1" alt="<?php echo(the_title()); ?>" class="thumbnail" /></a>
				<p><?php truncate_post(385); ?></p>
				<a href="<?php the_permalink() ?>" class="readmore"><span>Read More</span></a>
				<div class="clear"></div>
			</div> <!-- end new-post -->	
<?php } else { ?>
		<?php if ($i == $fullposts_num) { ?>
			<div id="mainposts">
		<?php } ?>
						
			<div class="mainpost-wrap<?php if (($i%2)<>0) echo (" first") ?>">
				<div class="bottom">
					<div class="inner-content">
						<?php if (get_option('glow_postinfo1_show') == 'on') include(TEMPLATEPATH . '/includes/postinfo-small.php'); ?>
						<h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php truncate_title(36); ?></a></h2>
						<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=65&amp;w=65&amp;zc=1" alt="<?php echo(the_title()); ?>" class="thumbnail" /></a>
						<p><?php truncate_post(79); ?></p>
					</div> <!-- end inner-content-->
				</div> <!-- end bottom-->
			</div> <!-- end mainpost-wrap-->
<?php }; ?>
<?php endwhile; ?>

<?php if ($i >= $fullposts_num) { ?>
	</div> <!-- end mainposts -->
<?php } ?>

<div class="clear"></div>
	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } 
	else { ?>
	<p class="pagination">
		<?php next_posts_link('&laquo; Previous Entries') ?>
		<?php previous_posts_link('Next Entries &raquo;') ?>
	</p>
	<?php } ?>
<?php else : ?>
	<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
<?php endif; wp_reset_query(); ?>